<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/base.php.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="images/favicon.ico" type="image-x-icon"  />
<!-- InstanceBeginEditable name="doctitle" -->
<title>CineBD - A divers&atilde;o espera voc&ecirc;</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="cinebd.js"></script>
<style type="text/css">

	body {
		
		/*background-color:#80CFD8;*/
		background-color:#FFFFFF;
		/*background-image:url(../images/bg_thin.png);
		background-repeat:repeat-x;*/
		font-family:"Courier New", Courier, monospace;
		top:0px;
		margin-top:0px;
		padding:0px;
	} 
	
	a {
		
		text-decoration:none;
		color:#000;
	}
	
	.menu {
		
		color:#000000;
		text-align:center;
		font-size:18px;
		font-family:"Courier New", Courier, monospace;
		//border-bottom: 1px solid #03C ;
	}
	
	.menu:hover {
		
		border: 2px solid #FFF;
		//border-left: 5px solid #FFF;
		//border-bottom: 5px solid #FFF;
		//border-right: 10px solid #fff;
		//background-color: #06F;
	}
	
	.logo {
		width:150px;
		height:150px;
	}
	
	.header {
		background-image:url(images/Template_03.png);
		//background-repeat:repeat-x;
		width:300px;
		height:149px;
		text-align:center;
	}
	
	.sub_header {
		
		background-image:url(images/sub_header.png);
		width:681px;
		height:100px;
		text-align:center;
		font-size:18px;
		font-weight:bold;
		font-family:"Courier New", Courier, monospace;
		
	}
	
	.logout {
		
		font-size:14px;
		color:#FFF;
		
	}
	
	.logout:hover {
		
		border-bottom: 2px solid #FFF;
		
	}
	
	.left_menu {
		
		background-image:url(images/bg_thin.png);
		background-attachment:fixed;
		width:356px;
		height:768px;
		vertical-align:top;
		text-align:center;
	}
	
	.right_menu {
		
		background-image:url(images/bg_thin.png);
		background-attachment:fixed;
		width:355px;
		height:768px;
		vertical-align:top;
		font-size:15px;
		font-family:"Courier New", Courier, monospace;
		text-align:center;
	}
	
	.right_menu_text {
		
		text-align:center;
		font-size:16px;
	}
	
	.right_menu_text:hover {
		
		border-bottom: 2px solid #FFF;
	}
	
	.bottom_bg {
		background-image:url(images/bottom_bg.png);
		background-repeat:y;
	}
	
	.proximas {
		text-align:center;
		font-weight:bold;
		font-size:18px;
	}
	

	.content {
		
		text-align:center;
		vertical-align:text-top;
		font-size:12px;
		font-family:"Courier New", Courier, monospace;
		width:auto;
	}
	
	.linhaSessao {
		background-color:#FF9;
		font-weight:bold;
		text-align:center;
			
	}
	
	.colunaDias {
		background-color:#FF9;	
		font-weight:bold;
	}
	
	.centroTabela {
		background-color:#CC3333;
		color:#FFF;
		font-weight:bold;
	}
	
	.colunaIngressos {
		background-color:#FF9;	
		font-weight:bold;
	}
	
	.centroIngressos {
		font-weight:bold;
		text-align:center;
		
	}

	.ingressosBaratos {
		color:#090;
		font-weight:bold;
		text-align:center;
		
	}
	
	.menu_admin {
		background-image:url(images/square.png);
		background-repeat:no-repeat;
		background-position:left;
		width:10px;
		height:10px;
		
	}
	
	
	
	<!-- TemplateBeginEditable name="css" -->
	
	<!-- TemplateEndEditable -->
</style>
</head>

<body>
<table align="center" cellpadding="0" cellspacing="0" border="0" style="top:0px;margin-top:0px;">
	<tr>
    	<td rowspan="3" class="left_menu">
        	<a href="index.php">
            	<img class="logo" src="images/logo.png" />
            </a>
            <br /> 
            
            <table width="100%" cellpadding="0" cellspacing="8" align="center">
            	<tr>
                	<td>
                    	<span class="menu"><a href="emcartaz.php">&nbsp;EM CARTAZ&nbsp;</a></span>
                    </td>
                 </tr>
                 <tr>
                	<td>
                    	<span class="menu"><a href="quemsomos.php">&nbsp;QUEM SOMOS&nbsp;</a></span>
                    </td>
                 </tr>
                 <tr>
                	<td>
                    	<span class="menu"><a href="faleconosco.php">&nbsp;FALE CONOSCO&nbsp;</a></span>
                    </td>
                 </tr>
                 <tr>
                	<td>
                    	<span class="menu"><a href="ingressos.php">&nbsp;INGRESSOS&nbsp;</a></span>
                    </td>
                 </tr>
                 <tr>
                	<td>
                    	<span class="menu"><a href="#" id="clientes">&nbsp;CLIENTES&nbsp;</a></span>
                        <br />
                        <div id="menu_client" style="text-align:left; font-size:15px; display:none; margin-left:25%;">
                        	<ol style="list-style-type:none;">
                            	<li><a href="login.php">Logar</a></li>
                                <li><a href="cadastro.php">Cadastrar</a></li>                    
                            </ol>
                        </div>
                    </td>
                 </tr>
            </table> 
  		</td>
        <td class="header">
        	<img src="images/header.png" />
        </td>
                
        <td rowspan="3" class="right_menu">
          	<img class="logo" src="images/popcorn.png" style="margin-left:10px"/>
        	<table width="100%" cellpadding="0" cellspacing="8">
            	<tr>
                	<td class="proximas">
                    	PR&Oacute;XIMAS ESTREIAS
                    </td>
                    </tr>
                    <br />
                    <tr>
                    <td>
         
		<?php
				require_once("php/config.php");
				require_once("php/postgres.php");
				
				try {
					
					$confs = $GLOBALS["CONFIGS"]["PSQL_DB"];
					$pgcon = new PostgresConnection($confs["HOST"], $confs["PORT"], $confs["USER"], $confs["PASSWORD"], $confs["DATABASE"]);
            
					$estreias = $pgcon->getAllEstreias();					

                    echo" <table width='100%' cellpadding='0' cellspacing='8' align='center'>";
                        foreach ($estreias as $estreia) {
                    		$nome = $estreia["nome"];
                            echo "<tr>
                                <td>
                                    <span class='right_menu_text'><a href='#' onclick=\"javascript:opensinopse('$nome');\">&nbsp;" . $nome .  "&nbsp;</a></span>
                                </td>
                            </tr>";
             			}
        			echo "</table>					
            </td>
            </tr>          
            </table>
        </td>
    </tr>";    
   
            if (isset($_COOKIE["checkLogin"])){
            
             	echo" <td class='sub_header'>Ol&aacute;, $_COOKIE[checkLogin]!
                <span class='logout'><a href='logout.php'>Sair</a></span></td></tr>";
                
            } else {
            
            	echo' <td class="sub_header"></td>';
            }
        
 		} catch (PostgresConnectionException $pce) {
            
        echo "<span style='color:red;'>Desculpa, mas sua requisi&ccedil;&atilde;o n&atilde;o pode ser processada agora. Volte mais tarde.</span>";
        }
                    
?>
        
    
    <tr>
    	<td class="content">
        	<!-- InstanceBeginEditable name="content" -->
            <script type="text/javascript">
				
				function triggerSend() {
				
					$("#email").attr("disbaled", "disabled");
					$("#assunto").attr("disbaled", "disabled");
					$("#coment").attr("disbaled", "disabled");
					$("#sub_but").attr("disbaled", "disabled");
					
					var email = $("#email").val();
					var assu = $("#assunto").val();
					var coment = $("#coment").val();
					
					if (email != "" && assu != "" && coment != "") {
						
						$.get("addcoment.php",
								{
									assunto : assu,
									email : email,
									coment : coment
								},
								function(data) {
									
									if (data != 0) {
										
										alert("Houve um erro ao enviar seu comentário.");
									} else {
										
										alert("Obrigado. Seu comentário foi enviado com sucesso.");
										document.forms[0].reset();
									}
									
									$("#email").removeAttr("disbaled");
									$("#assunto").removeAttr("disbaled");
									$("#coment").removeAttr("disbaled");
									$("#sub_but").removeAttr("disbaled");
								});
					} else {
					
						alert("Preencha todos os campos");	
					}
				}
				
				$(document).ready(function() {
					
									$("#sub_but").click(triggerSend);
								  });
			</script>
			<br />

            <div style="text-align:left; margin-left:40px;">
            <span class="proximas">FALE CONOSCO</span>
            <br />
            <br />
            <form id="faleform" onsubmit="return false;">
            	<table cellpadding="0" cellspacing="0" border="0">
                	<tr>
            			<td><span>E-mail: &nbsp;&nbsp;</span></td>
                        <td><input id="email" name="email" type="text" size="50" maxlength="50" /></td>
                    </tr>
                    <tr>
                		<td><span>Assunto: </span></td>
                        <td><input id="assunto" name="assunto" type="text" size="50" maxlength="50" /></td>
                    </tr>
                </table>
                <br />
                <span> Sugest&otilde;es e Coment&aacute;rios
                <br />
                <textarea id="coment" name="coment" rows="10" cols="48"></textarea>
                <br />
                <input id="sub_but" type="button" value="Enviar" />
            </form>
            </div>
			<!-- InstanceEndEditable -->
    </tr>    
</table>
</body>
<!-- InstanceEnd --></html>
